﻿

// =================================================================== 
// Module说明
//====================================================================
// 创建时间：2017-09-25 11:09:51
// 负责人：Sushee
// ===================================================================

using System;
using System.ComponentModel;
using System.Text;
using YouWei.Utility.Logging;

namespace YouWei.Utility.Logging
{
	#region ErrorLog数据实体
	/// <summary>
	///异常日志数据实体  
	/// </summary>
	[Serializable]
	public class ErrorLog:BaseLog2
	{
		
		#region 公共属性
		
		///<summary>
		///主键
		///</summary>
        [Description("主键")]
		public long ErrorLogID
		{
		    get;set;
		}

		///<summary>
		///错误信息
		///</summary>
        [Description("错误信息")]
		public string ErrorMessage
		{
		    get;set;
		}

		///<summary>
		///错误来源
		///</summary>
        [Description("错误来源")]
		public string ErrorSource
		{
		    get;set;
		}

		///<summary>
		///错误跟踪
		///</summary>
        [Description("错误跟踪")]
		public string ErrorTrace
		{
		    get;set;
		}

        #endregion

        public ErrorLog()
        {
            CreatedDate = DateTime.Now;
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder("详情：");
            sb.AppendLine("RequestMethod：" + this.RequestMethod);
            if (!string.IsNullOrEmpty(this.RequestUrl))
            {
                sb.AppendLine("RequestUrl：" + this.RequestUrl);
            }
            if (!string.IsNullOrEmpty(this.APPVersion))
            {
                sb.AppendLine("APPVersion：" + this.APPVersion);
            }
            if (this.Platform > 0)
            {
                sb.AppendLine("Platform：" + this.Platform);
            }
            if (!string.IsNullOrEmpty(this.PlatformVersion))
            {
                sb.AppendLine("PlatformVersion：" + this.PlatformVersion);
            }
            sb.AppendLine("UserID：" + this.UserID);
            if (!string.IsNullOrEmpty(this.PostData))
            {
                sb.AppendLine("PostData：" + this.PostData);
            }          
            if (!string.IsNullOrEmpty(this.UA))
            {
                sb.AppendLine("UA：" + this.UA);
            }
            if (!string.IsNullOrEmpty(this.Vendor))
            {
                sb.AppendLine("Vendor：" + this.Vendor);
            }
            if (!string.IsNullOrEmpty(this.Model))
            {
                sb.AppendLine("Model：" + this.Model);
            }
            if (!string.IsNullOrEmpty(this.Token))
            {
                sb.AppendLine("Token：" + this.Token);
            }
            if (!string.IsNullOrEmpty(this.ClientId))
            {
                sb.AppendLine("ClientId：" + this.ClientId);
            }
            if (!string.IsNullOrEmpty(this.Moble))
            {
                sb.AppendLine("Moble：" + this.Moble);
            }
            if (!string.IsNullOrEmpty(this.Imei))
            {
                sb.AppendLine("Imei：" + this.Imei);
            }
            if (!string.IsNullOrEmpty(this.Uuid))
            {
                sb.AppendLine("Uuid：" + this.Uuid);
            }
            if (!string.IsNullOrEmpty(this.Imei))
            {
                sb.AppendLine("Imei：" + this.Imei);
            }
            sb.AppendLine("CreatedDate：" + this.CreatedDate.ToString("yyyy-MM-dd HH:mm:ss"));
            if (!string.IsNullOrEmpty(this.ClientIP))
            {
                sb.AppendLine("ClientIP：" + this.ClientIP);
            }
            if (!string.IsNullOrEmpty(this.ErrorSource))
            {
                sb.AppendLine("ErrorSource：" + this.ErrorSource);
            }
            if (!string.IsNullOrEmpty(this.ErrorMessage))
            {
                sb.AppendLine("ErrorMessage：" + this.ErrorMessage);
            }
            if (!string.IsNullOrEmpty(this.ErrorTrace))
            {
                sb.AppendLine("ErrorTrace：" + this.ErrorTrace);
            }

            return sb.ToString();
        }
    }
	#endregion
}